package com.zzyl.controller.customer;


import com.zzyl.base.PageResponse;
import com.zzyl.base.ResponseResult;
import com.zzyl.queryparam.NursingProjectQueryParam;
import com.zzyl.service.NursingProjectService;
import com.zzyl.vo.NursingProjectVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/customer/orders/project")
@Api(tags = "服务项接口")
public class CustomerOrdersController {

    @Autowired
    private NursingProjectService nursingProjectService;

    @GetMapping("/page")
    @ApiOperation("分页查询护理项目列表")
    public ResponseResult<PageResponse<NursingProjectVo>> getPage(NursingProjectQueryParam npqp) {

        PageResponse<NursingProjectVo> pageResponse = nursingProjectService.getPage(npqp);

        return ResponseResult.success(pageResponse);
    }


    @GetMapping("/{id}")
    @ApiOperation("根据编号查询护理项目信息")
    public ResponseResult getByIdNursingProject(@PathVariable Long id) {

        NursingProjectVo npv = nursingProjectService.getByIdNursingProject(id);

        return ResponseResult.success(npv);
    }
}
